package com.aglow.hyyff;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import com.aglow.eventbus.bean.Event;
import com.aglow.eventbus.until.EventUntils;
import com.aglow.hyyff.base.BaseActivity;
import com.aglow.hyyff.bean.Code;
import com.aglow.hyyff.bean.EventTest;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

public class EventTestActivity extends BaseActivity {
    private TextView textView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_event_test);
        textView = findViewById(R.id.tv_show_success);

    }


    @Override
    protected void disposeEvent(Event event) {
        Log.i("test", "6666666666");
        if (event != null) {
            EventTest eventTest = (EventTest) event.getData();
            if (eventTest.getCode() == Code.A) {
                Log.i("test", "string = " + eventTest.getS());
                textView.setVisibility(View.VISIBLE);
            }
        }

    }

    @Override
    protected boolean isRegister() {
        return true;
    }
}
